home *** CD-ROM | disk | FTP | other *** search
/ PC Advisor 2011 May / PC Advisor 190 E.iso / pc / ESSENTIALS / VLC Media Player 1.1 / vlc-1.1.5-win32.exe / sdk / include / vlc / plugins / vlc_cpu.h < prev    next >
Encoding:
C/C++ Source or Header  |  2010-11-13  |  2.9 KB  |  94 lines

  1. /*****************************************************************************
  2.  * vlc_cpu.h: CPU capabilities
  3.  *****************************************************************************
  4.  * Copyright (C) 1998-2009 the VideoLAN team
  5.  *
  6.  * This program is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation; either version 2 of the License, or
  9.  * (at your option) any later version.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program; if not, write to the Free Software
  18.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  19.  *****************************************************************************/
  20.  
  21. /**
  22.  * \file
  23.  * This file provides CPU-specific optimization flags.
  24.  */
  25.  
  26. #ifndef VLC_CPU_H
  27. # define VLC_CPU_H 1
  28.  
  29. # if defined (__i386__) || defined (__x86_64__)
  30. #  define CPU_CAPABILITY_MMX     (1<<3)
  31. #  define CPU_CAPABILITY_3DNOW   (1<<4)
  32. #  define CPU_CAPABILITY_MMXEXT  (1<<5)
  33. #  define CPU_CAPABILITY_SSE     (1<<6)
  34. #  define CPU_CAPABILITY_SSE2    (1<<7)
  35. #  define CPU_CAPABILITY_SSE3    (1<<8)
  36. #  define CPU_CAPABILITY_SSSE3   (1<<9)
  37. #  define CPU_CAPABILITY_SSE4_1  (1<<10)
  38. #  define CPU_CAPABILITY_SSE4_2  (1<<11)
  39. #  define CPU_CAPABILITY_SSE4A   (1<<12)
  40. # else
  41. #  define CPU_CAPABILITY_MMX     (0)
  42. #  define CPU_CAPABILITY_3DNOW   (0)
  43. #  define CPU_CAPABILITY_MMXEXT  (0)
  44. #  define CPU_CAPABILITY_SSE     (0)
  45. #  define CPU_CAPABILITY_SSE2    (0)
  46. #  define CPU_CAPABILITY_SSE3    (0)
  47. #  define CPU_CAPABILITY_SSSE3   (0)
  48. #  define CPU_CAPABILITY_SSE4_1  (0)
  49. #  define CPU_CAPABILITY_SSE4_2  (0)
  50. #  define CPU_CAPABILITY_SSE4A   (0)
  51. # endif
  52.  
  53. # if defined (__ppc__) || defined (__ppc64__) || defined (__powerpc__)
  54. #  define CPU_CAPABILITY_ALTIVEC (1<<16)
  55. # else
  56. #  define CPU_CAPABILITY_ALTIVEC (0)
  57. # endif
  58.  
  59. # if defined (__arm__)
  60. #  define CPU_CAPABILITY_NEON    (1<<24)
  61. # else
  62. #  define CPU_CAPABILITY_NEON    (0)
  63. # endif
  64.  
  65. VLC_EXPORT( unsigned, vlc_CPU, ( void ) );
  66.  
  67. /** Are floating point operations fast?
  68.  * If this bit is not set, you should try to use fixed-point instead.
  69.  */
  70. # if defined (__i386__) || defined (__x86_64__)
  71. #  define HAVE_FPU 1
  72.  
  73. # elif defined (__powerpc__) || defined (__ppc__) || defined (__pc64__)
  74. #  define HAVE_FPU 1
  75.  
  76. # elif defined (__arm__)
  77. #  define HAVE_FPU 0 /* revisit later? */
  78.  
  79. # elif defined (__sparc__)
  80. #  define HAVE_FPU 1
  81.  
  82. # else
  83. #  define HAVE_FPU 0
  84.  
  85. # endif
  86.  
  87. typedef void *(*vlc_memcpy_t) (void *tgt, const void *src, size_t n);
  88. typedef void *(*vlc_memset_t) (void *tgt, int c, size_t n);
  89.  
  90. VLC_EXPORT( void, vlc_fastmem_register, (vlc_memcpy_t cpy, vlc_memset_t set) );
  91.  
  92. #endif /* !VLC_CPU_H */
  93.  
  94.